<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: red;
        }
        .boxs{
            width: 100px;
            height: 100px;
            background-color: rgb(255, 221, 0);
        }
    </style>
    </style>
</head>
<body>
    <div id="root" class="box">
        daohang
    </div>
    <div class="box">text</div>

    <script>
        var x = document.getElementById("box");
        root.id = "roots"
        roots.className = "boxs";
        console.log(roots.id);
        console.log(roots.className);

        
    </script>
</body>
</html>